#ifndef CBCALCUIEDIT_H_
#define CBCALCUIEDIT_H_

#include <mzfc_inc.h>
#include "Pipe.h"

class CBCalcUiEdit: public UiEdit
{
private:
    Pipe            m_CalcPipe;
    int             m_OldHeight;
    HANDLE          m_threadStdout;
    HANDLE          m_threadStderr;

public:
    CBCalcUiEdit();
    ~CBCalcUiEdit();
    void UiWinProc(LPARAM lParam);
    void OnInit();

    /* called by two threads, must be public, ugly :-( */
    void postStdout();
    void postStderr();

    void appendString(const char* buf, DWORD bytes);

    int sendExpression();

protected:
    int OnChar(TCHAR chCharCode, LPARAM lKeyData);
};

#endif  /* CBCALCUIEDIT_H_  */

